﻿using YOYO.HRMS.Utility;

namespace YOYO.HRMS.BusinessLogic
{
    public class CurrentParemeter
    {
        /// <summary>
        /// 获取当前登录的公司ID
        /// </summary>
        /// <returns></returns>
        public static long GetCurrentCorporateId()
        {
            var corpId = SessionHelper.GetSession("CorporateID");
            if (corpId == null)
                //throw new Exception("Current Corporate is null!");
                return 1;
            return long.Parse(corpId.ToString());
        }

        /// <summary>
        /// 获取当前登录的userID
        /// </summary>
        /// <returns></returns>
        public static long GetuserID()
        {
            var userID = SessionHelper.GetSession("UserID");
            if (userID == null)
                return -1;
            return long.Parse(userID.ToString());
        }
    }
}
